<page-header model="navModel"></page-header>

<div class="page-container page-body">
	<h2 class="page-sub-heading"><!--Edit Organization-->编辑组织</h2>

	<form name="orgDetailsForm" class="gf-form-group">
		<div class="gf-form">
			<span class="gf-form-label width-10"><!--Name-->名称</span>
			<input type="text" required ng-model="org.name" class="gf-form-input max-width-14" >
		</div>

		<div class="gf-form-button-row">
			<button type="submit" class="btn btn-success" ng-click="update()" ng-show="!createMode"><!--Update-->更新</button>
		</div>
	</form>

	<h3 class="page-heading"><!--Organization Users-->组织用户</h3>

	<table class="filter-table">
		<tr>
			<th><!--Username-->用户名</th>
			<th>Email</th>
			<th><!--Role-->角色</th>
			<th></th>
		</tr>
		<tr ng-repeat="orgUser in orgUsers">
			<td>{{orgUser.login}}</td>
			<td>{{orgUser.email}}</td>
			<td>
        <div class="gf-form">
          <span class="gf-form-select-wrapper">
              <select type="text" ng-model="orgUser.role" class="gf-form-input max-width-8" ng-options="k as v for (k,v) in {'Viewer':'观众', 'Editor':'编辑', 'Admin':'管理员'}" ng-change="updateOrgUser(orgUser)">
              </select>
          </span>
        </div>
			</td>
			<td style="width: 1%">
				<a ng-click="removeOrgUser(orgUser)" class="btn btn-danger btn-mini">
					<i class="fa fa-remove"></i>
				</a>
			</td>
		</tr>
	</table>
</div>
